﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using NickLee.Common;
using System.Data;

namespace GPCSC.Web.sjs
{
    public partial class ggfklist :  PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                f_bund();
            }
        }
        protected void f_bund()
        {
            try
            {
                byte[] userInfo = (byte[])base.o_baseTable[c_obj.s_userInfo];
                Hashtable userInfoTable = CompressData.UnCompressHashtable(userInfo);
                Model.CL_USER_S users = (Model.CL_USER_S)userInfoTable["SYS_USER"];

                Hashtable htable = new Hashtable();
                htable.Add("@lgid", users.CL_USER_SOID.ToString());
                DataSet ds = new DataSet();
                ds = new SqlReadXml().ReaderDataSet("ggfkall", htable);
                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            foreach (DataRow dr in ds.Tables[0].Rows)
                            {
                                if (dr["ggvalue"].ToString() == "1")
                                {
                                    dr["typevalue"] = "农村";
                                }
                                else if (dr["ggvalue"].ToString() == "2")
                                {
                                    dr["typevalue"] = "企业";
                                }
                                else if (dr["ggvalue"].ToString() == "3")
                                {
                                    dr["typevalue"] = "社区";
                                }
                            }
                            PostListS.DataSource = ds;
                            PostListS.DataBind();
                            this.pageinfo.InnerHtml = new FYpage().GetPageNum(ds.Tables[0], PostListS, 10);
                        }
                    }
                }
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }

        protected string IsZuoFei(object iszuofei)
        {
            string zuofei = string.Empty;

            if (Convert.ToString(iszuofei) == "1")
            {
                zuofei = "<font color='red'>是</font>";
            }
            else
            {
                zuofei = "否";
            }

            return zuofei;

        }
    }
}